package gerneric

object GenericDemo03 {
  def main(args: Array[String]): Unit = {
    val lsit1 = List("hello", "dog", "world")
    val list2 = List(90, 10, 21)
    println(midList[String](lsit1))
    println(midList[Int](list2))
  }

  def midList[E](l: List[E]): E = {
    l(l.length / 2)
  }
}
